/*===============================================================
*   Copyright (C) 2017 All rights reserved.
*   
*   文件名称：global.h
*   创 建 者：陈迪林
*   创建日期：2017年08月07日
*   描    述：
*
*   更新日志：
*
================================================================*/
#ifndef _GLOBAL_H
#define _GLOBAL_H

#define MAXUSER  100
#define USERIDSIZE      20
#define USERDATASIZE    1000
#define MAXUSER         100
#define CMDSIZE         1

#define CMD_LOGIN       1
#define CMD_REGISTER    2
#define CMD_LOGINSUCCESS    3
#define CMD_REGISTERSUCCESS 4
#define CMD_LOGINFAILED     5
#define CMD_REGISTERFAILED  6
#define CMD_REGISTEREXISTS  7

#define CMD_GetOnlineuser   8
#define CMD_Onlineuser      9
#define CMD_USERDATA        10
#define CMD_REPEATLOGIN     11
#define CMD_CLOSECHAT       12

#define DATASIZE        CMDSIZE + USERIDSIZE*2 + USERDATASIZE

typedef struct user_data
{
    unsigned char cmd;
    char dst_id[USERIDSIZE];
    char src_id[USERIDSIZE];
    char data[USERDATASIZE];
}USER_DATA;

typedef struct usr_info
{
    char id[USERIDSIZE];
    int sock;
}USER_INFO;


#endif
